package com.example.echoewish.repository.database.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;

import com.example.echoewish.pojo.ChatEntity;

import java.util.List;

@Dao
public interface ChatEntityDao {

    @Insert
    void insertChatEntityDao(ChatEntity chatEntity);

    @Query("select * from ChatEntity where (myId=:myId and otherId=:otherId) or (myId=:otherId and otherId=:myId)")
    List<ChatEntity> getHistoricalRecords(int myId,int otherId);

    @Query("delete from ChatEntity")
    void deleteChatEntityDao();
}
